import request from '@/utils/request'

//查询全部
export function loadAllDic() {
    return request({
        url: '/system/dic/type/loadAllDic',
        method: 'get'
    })
}

//分页查询
export function loadDicByPage(params) {
    console.log(params)
    return request({
        url: '/system/dic/type/loadDicByPage',
        method: 'get',
        params: params
    })
}

//插入字典
export function insertDic(data) {
    return request({
        url: '/system/dic/type/insertDic',
        method: 'post',
        params: data
    })
}

//修改字典
export function modifyDic(data) {
    return request({
        url: '/system/dic/type/modifyDic',
        method: 'put',
        params: data
    })
}

//删除字典
export function removeDic(data) {
    return request({
        url: '/system/dic/type/removeDic/' + data,
        method: 'delete',
    })
}

//根据编号查询
export function getDictTypeById(data) {
    return request({
        url: '/system/dic/type/getDictTypeById/' + data,
        method: 'get',
    })
}

//初始化字典
export function dictCacheAsync() {
    return request({
        url: '/system/dic/type/dictCacheAsync',
        method: 'get'
    })
}